package com.share.device.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.share.device.domain.RegionLocation;
import com.share.device.mapper.RegionLocationMapper;
import com.share.device.service.IRegionLocationService;
import org.springframework.stereotype.Service;

/**
 * @version 1.0
 * @author: CY_Guo
 * @date: 2025/5/19 17:29
 * @Descript TODO 请概括该类
 */
@Service
public class RegionLocationServiceImpl extends ServiceImpl<RegionLocationMapper, RegionLocation> implements IRegionLocationService {
    @Override
    public RegionLocation getLocationByDistrictCode(String districtCode) {
        // select * from region_location where district_code = ?
        return this.getOne(new LambdaQueryWrapper<RegionLocation>().eq(RegionLocation::getDistrictCode, districtCode));
    }

    // 保存到数据库
    @Override
    public void saveLocation(RegionLocation location) {
        this.save(location);
    }
}
